/**
 * @description 清单模型类
 * @author AI Assistant
 * @date 2023-10-27
 */

import { BaseModel } from './base'
import { IconSystem } from '@/utils/constants.js';

export class List extends BaseModel {
  constructor(data = {}) {
    super(data)
    this.title = data.title || ''
    // 如果没有提供图标，根据标题自动选择
    this.icon = data.icon || (data.title ? IconSystem.getIconByTitle(data.title) : 'tags')
    this.groups = data.groups || []
  }

  toJSON() {
    return {
      ...super.toJSON(),
      title: this.title,
      icon: this.icon,
      groups: this.groups
    }
  }
} 